package graph.element.shape;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;

import graph.GraphPanel;
import graph.color.Color;

public class NullForm extends Shape {
	
	public NullForm(GraphPanel graphingData, boolean value, Color color, double x, double y, int xInc, int yInc, int val, int max) {
		super(graphingData, x, y, value, color, val, max);
	}
	public void draw() {
	    drawValue();
	}
	
	public void drawValue() {
		if (value) {
			Graphics g = getG();
			Graphics2D g2 = (Graphics2D)g;
			java.awt.Color restore = g2.getColor();
	    	g2.setColor(java.awt.Color.BLACK);
	    	FontMetrics fm = g.getFontMetrics();
	    	int width = fm.stringWidth("" + val);
	    	int height = fm.getHeight();
	    	g2.drawString("" + val, (int) (x - width/2), (int) (y + height/3));
	    	g2.setColor(restore);
		}
	}
}
